const sql = require("../../../config/web-question-config");

// 获取notice
function getNotice() {
  return sql("select * from notice");
}

// 添加notice
function addNotice(arr) {
  return sql("insert into notice value (NULL,?,?,1,?)", arr);
}

// 修改notice
function updateNotice(arr) {
  return sql("update notice set text = ? , atime = ? where notice_id = ?", arr);
}

// 删除notice
function deleteNotice(arr) {
  return sql("delete from notice where notice_id = ?", arr);
}

// 是否展示notice
function showNotice(arr) {
  return sql("update notice set isNotice = ? where notice_id = ?", arr);
}

module.exports = {
  getNotice,
  addNotice,
  updateNotice,
  deleteNotice,
  showNotice,
};
